using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using UnityEngine.XR;

[RequireComponent(typeof(Rigidbody2D))]
public class GenerateGravity : MonoBehaviour
{
    private Rigidbody2D rigidbody;
    [SerializeField] private bool AutoGravity;

    private void Awake()
    {
        rigidbody = GetComponent<Rigidbody2D>();
    }

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void FixedUpdate()
    {
        if (AutoGravity)
        {
            GravityController.Instance.FunctionGravity(rigidbody);
        }
    }
}
